<link href="__PUBLIC__/admin/css/massagemanage.css" rel="stylesheet">
<script src="__PUBLIC__/admin/kindeditor-4.1.7/kindeditor-min.js"></script>
<script src="__PUBLIC__/admin/kindeditor-4.1.7/kindeditor-all-min.js"></script>
<div class="row">
	<ol class="breadcrumb">
		<li><a href="{:U('Index/index')}"><span class="glyphicon glyphicon-home"></span></a></li>
		<li class="active">添加文章</li>
	</ol>   
</div><!--/.row-->
<div class="row">
	<div class="col-lg-12">
		<h2>文章显示</h2>
			<table data-toggle="table" data-url="tables/data2.json" class="table table-hover">
				<thead>
					<tr>
						<th>用户名</th>
						<th>联系方式</th>
						<th>时间</th>
						<th>文章内容</th>
						<th>上传图片</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				<?php foreach($casenewslist as $k => $v) { ?>
					<tr>
						<td><?php echo $v["name"]; ?></td>
						<td><?php echo $v["title"]; ?></td>
						<td><?php echo $v["time"]; ?></td>
						<td><?php echo $v["content"]; ?></td>
						<td><img style="width:60px;" src="<?php echo $v['imgurl'];?>" alt=""></td>
						<td><a href="{:U('ContactUs/caseDel?id='.$v['Id'])}">删除</a></td>
					</tr>
				<?php } ?>
				</tbody>
			</table>
			<h2>添加文章</h2>
			<form action="{:U('ContactUs/addContent')}" method="post" enctype="multipart/form-data">
					<!-- <div class="form-group">
						<label>用户名</label>
						<input class="form-control" name="name" placeholder="用户名" >
					</div> -->								
					<div class="form-group">
						<label>文章标题</label>
						<input class="form-control" name="title" placeholder="联系方式" >
					</div>
					<div class="form-group">
						<label>文章内容</label>
						<textarea id="editor_id" name="content" style="width:700px;height:300px;">
						</textarea>
					</div>
					<!-- 图片上传 --> 
					<div class="form-group">
					<label>图片上传</label>
					<input type="file" name="imgurl">
					 <p class="help-block">上传图片大小不超过2M</p>
					</div>
					<button type="submit" class="btn btn-primary">确认上传</button>
			</form>
				<?php foreach($casenewslist as $k => $v) { ?>
				<?php } ?>		
	</div>
</div>
<script charset="utf-8" src="/editor/kindeditor.js"></script>
    <script charset="utf-8" src="/editor/lang/zh-CN.js"></script>
    <script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#editor_id');
        });
</script>